 <!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="pragma" content="no-cache">
<title>天小天个人网-留言</title>
<link rel="shortcut icon " type="images/x-png" href="../../public/pic/icon.png">
<link href="../css/comment.css" type="text/css" rel="stylesheet">
<link href="../../public/bs/css/bootstrap.min.css" type="text/css" rel="stylesheet">
<script src="../../public/bs/js/jquery-3.3.1.min.js" type="text/javascript"></script>
<script src="../../public/bs/js/bootstrap.min.js" type="text/javascript"></script>
<script src="../js/comment.js" type="text/javascript"></script>
</head>

<body>
	<nav class="navbra navbar-default" >
    <div class="container-fluid">
        <div class="navbar-header">
            <button class="navbar-toggle" data-toggle="collapse" data-target="#example-navbar-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a href="../model/index.php" class="navbar-brand nav-title">
                天小天个人网
            </a>
        </div>
        <div class="collapse navbar-collapse" id="example-navbar-collapse">
            <ul class="nav navbar-nav">
                <li class=""><a href="../model/index.php">首页</a></li>
                <li class=""><a href="../model/resume.php">个人简历</a></li>
                <li class=""><a href="../model/dynamic.php">我的动态</a></li>
                <li class=""><a href="../model/web.php">web技术</a></li>
                <li class=""><a href="../model/index.php">网站协会</a></li>
                <li class="active"><a href="../model/comment.php">给我留言</a></li>
                <li>
                    <a href="<?php echo $herf ?>">
                        <img src="<?php echo $photo ?>" style="width:20px;height:20px;" class="img-circle">
                    </a>
                </li>
            </ul>
        </div>
    </div>
    </nav>
    <div class="container" >
      <h1 class="text-center">留言板</h1>
      <form method="post" action="" class="comment_form">
        <div class="form-group">
          <label>留&nbsp;&nbsp;&nbsp;言：</label>
          <textarea name="comment_text" class="form-control" rows="4"></textarea>
        </div>
        <div class="form-group">
          <input type="submit" name="submit" value="留言" class="btn btn-primary col-xs-6 col-xs-offset-3" />
        </div>
      </form>
    </div>
    <div class="container">
        <h1 class="col-md-12 text-center">
            留言列表
        </h1>
        <?php foreach($commentdata as $v){ ?>
        <div class="col-md-12 comment_box">
            <div class="com_top col-lg-12">
                <span class="com_photo">
<?php
if(file_exists('../../upload/userphoto/userphoto_'.$v['userid'].'.jpg')){
    $userphoto='../../upload/userphoto/userphoto_'.$v['userid'].'.jpg';
}else{
    $userphoto='../../upload/userphoto/userphoto_0.jpg';
}

                    ?>

                    <img src="<?php echo $userphoto ?>"style="width:60px;height: auto;border: 1px solid #ccc;" class="img-circle"/>
                </span>
                <span class="com_user">
                    <h4><?php echo $v['commentusername']; ?></h4>
                    <p><?php echo $v['commenttime']; ?></p>
                </span>
            </div>
            <div class="com_bto col-lg-12">
                <?php echo $v['commenttext']; ?>
            </div>
        </div>
        <?php } ?>
    </div>
</body>
</html>